<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Drill-through samples</title>
<script type="text/javascript" src="js/chartAjaxAPI.js"></script>
<script type="text/javascript">
function generateChart()
{
	// Construct data according to country
	var country = "China";
	var categories = "Shanghai,Beijing,Nanjing,HK";
	var values = "20000000,15000000,10000000,11000000";
	if(location)
	{
		country = new String(location);
		var startIndex = country.indexOf("country=");
		if(startIndex>=0)
		{
			country = country.substring(startIndex+8);
		}
	}
	if(country=="USA")
	{
		categories = "New York,Los Angles,Houston";
		values = "6000000,8000000,5000000";
	} else if(country=="EU")
	{
		categories = "France,Germany,Italy";
		values = "84000000,62000000,60000000";
	}
	
	var cm = new ChartModel( 500, 400 );
	cm.setType("pie");
	cm.setFormat("png");
	cm.setDimension("2.5d");
	cm.setColorByCategory(true);
	cm.setShowLegend(true);
	cm.setShowLabel(true);
	cm.setTitle(country + " Population");
	cm.setCategories(categories);
	cm.setValues(values);
	cm.setTooltips(values);
	
	var chart = new BirtChart();
	chart.setDataXML(cm);		
	chart.render("chartDiv");
}

</script>
</head>
<body onload="generateChart()">
<div id="chartDiv"></div>
</body>
</html>